<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 3000px;
            background:black;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <button>wwwwww</button>
    <script>
        // function changefont(){
        //     var w = window.innerWidth;
        //     var s = w/20;
        //     document.documentElement.style.fontSize=s+"px"
        // }
        // changefont();
        // window.onresize = function(){
        //     changefont()
        // }


        // 滚动事件
        window.onscroll = function(){
            console.log(document.body.scroll)
        }
        var btn = document.querySelector("button");
        btn.onclick = function(){
            document.body.scrollTop= 0
        }
    </script>
</body>
</html>